// import Home from '@/views/Home.vue'
import information from '@/views/information.vue'
import score from '@/views/score.vue'
import Freshman from '@/views/Freshman.vue'
import Junior from '@/views/Junior.vue'
import Senior from '@/views/Senior.vue'
import Sophomore from '@/views/Sophomore.vue'
import Paid from '@/views/Paid.vue'
import Home from '@/views/Home.vue'
import AdminManageHome from '@/views/AdminManageHome.vue'
export default [
    // {
    //     path:'',
    //     redirect:{
    //         name:'Home'
    //     }
    // },
    // {
    //     path:'home',
    //     name:'Home',
    //     component:Home,
    // },
    // {
    //     path:'goods',
    //     children:[
    // /manage/goods -> /manage/list
    // {
    //     path:'goods',
    //     redirect:{name:'GoodsList'}
    // },

    {
        path: '/manage/home',
        name: 'Home',

        component: Home
    },
    {
        path: '/manage/information',
        name: 'information',

        component: information
    },
    {
        path: '/manage/score',
        name: 'score',
        component: score
    },
    {
        path: '/manage/establish',
        redirect: {
            name: 'Freshman'
        }
    },
    {
        path: '/manage/establish/Freshman/:grade',
        name: 'Freshman',
        // props:{grade:"大一"},
        component: Freshman
    },
    {
        path: '/manage/establish/Sophomore/:grade',
        name: 'Sophomore',
        component: Sophomore
    },
    {
        path: '/manage/establish/Junior/:grade',
        name: 'Junior',
        component: Junior
    },
    {
        path: '/manage/establish/Senior/:grade',
        name: 'Senior',
        component: Freshman
    },
    {
        path: '/manage/Paid',
        name: 'Paid',
        component: Paid
    },
    {
        path: '/manage/Paid/Freshman',
        name: 'Paid',
        // component:Paid
    },
    {
        path: '/manage/Paid/Freshman/gradeOne/:grade',
        name: 'Freshman',
        // props:{grade:"大一"},
        component: Freshman
    },
    {
        path: '/manage/Paid/Freshman/gradeTow/:grade',
        name: 'Freshman',
        // props:{grade:"大一"},
        component: Freshman
    },
    {
        path: '/manage/Paid/Sophomore/:grade',
        name: 'Sophomore',
        component: Sophomore
    },
    {
        path: '/manage/Paid/Sophomore/gradeOne/:grade',
        name: 'Freshman',
        // props:{grade:"大一"},
        component: Freshman
    },
    {
        path: '/manage/Paid/Sophomore/gradeTow/:grade',
        name: 'Freshman',
        // props:{grade:"大一"},
        component: Freshman
    },
    {
        path: '/manage/Paid/Junior/:grade',
        name: 'Junior',
        component: Junior
    },
    {
        path: '/manage/Paid/Junior/gradeOne/:grade',
        name: 'Freshman',
        // props:{grade:"大一"},
        component: Freshman
    },
    {
        path: '/manage/Paid/Junior/gradeTow/:grade',
        name: 'Freshman',
        // props:{grade:"大一"},
        component: Freshman
    },
    {
        path: '/manage/Paid/Senior/:grade',
        name: 'Senior',
        component: Senior
    },
    {
        path: '/manage/Paid/Senior/gradeOne/:grade',
        name: 'Freshman',
        // props:{grade:"大一"},
        component: Freshman
    },
    {
        path: '/manage/Paid/Senior/gradeTow/:grade',
        name: 'Freshman',
        // props:{grade:"大一"},
        component: Freshman
    },
    //     ]
    // },

    // {
    //     path:'user',
    //     redirect:{name:'UserList'}
    // },
    // {
    //     path:'Paid',
    //     name:'Paid',
    //     component:Paid
    // },
    // {
    //     path:'user/add',
    //     name:'AddUser',
    //     component:AddUser
    // },
    // {
    //     path:'user/edit',
    //     name:'EditUser',
    //     component:AddUser
    // },
]
// }
export const adminRouter = () => {
    const RouterList = JSON.parse(localStorage.getItem('RouterList'))
    console.log("RouterList", RouterList);
    // const res = [{
    //     path: '/AdminManageHome',
    //     name: 'AdminManageHome',
    //     component: AdminManageHome
    // }, 
    if (!(RouterList?.length > 0)) {
        return
    }
    let res = [{
        path: '/AdminManageHome',
        name: 'AdminManageHome',
        component: AdminManageHome
    }]
    RouterList.map((item, ind) => {
        return item.classList.map((ite, index) => {

            return ite.studentList.map((it, indx) => {
                const r = [{
                    path: `/AdminManage/${item._id}/class${index+item._id}/studentName${indx+''+index}/grade1${+indx+''+index}/:grade`,
                    name: 'Freshman',
                    component: Freshman
                }, {
                    path: `/AdminManage/${item._id}/class${index+item._id}/studentName${indx+''+index}/grade2${+indx+''+index}/:grade`,
                    name: 'Freshman',
                    component: Freshman
                }, {
                    path: `/AdminManage/${item._id}/class${index+item._id}/studentName${indx+''+index}/grade3${+indx+''+index}/:grade`,
                    name: 'Freshman',
                    component: Freshman
                }, {
                    path: `/AdminManage/${item._id}/class${index+item._id}/studentName${indx+''+index}/grade4${+indx+''+index}/:grade`,
                    name: 'Freshman',
                    component: Freshman
                }]
                res.push(...r)
                return res
            })

        })


    })
    return res
    return [{
            path: '/AdminManageHome',
            name: 'AdminManageHome',
            component: AdminManageHome
        }, {
            path: '/AdminManage/TheFineArts/class19/studentName/grade/:grade',
            name: 'Freshman',
            component: Freshman
        },
        {
            path: '/AdminManage/TheFineArts/class18/studentName/grade/:grade',
            name: 'Freshman',
            component: Freshman
        },
    ]
}